import Vue from 'vue'
import Router from 'vue-router'
import layout from '@/components/layout/index'

Vue.use(Router)

export default new Router({
  routes: [
    { path: '/', redirect: '/login' },
    {
      path: '/login',
      name: 'login',
      component: resolve => require(['@/views/login/index.vue'], resolve)
    },
    {
      path: '/',
      name: 'layout',
      component: layout,
      children: [
        {
          path: '/vuex',
          name: 'vuex',
          component: resolve => require(['@/views/vuex/index.vue'], resolve)

        },
        {
          path: '/imgUpload',
          name: 'imgUpload',
          component: resolve => require(['@/views/imgUpload/index.vue'], resolve)
        },
        {
          path: '/importAndExport',
          name: 'importAndExport',
          component: resolve => require(['@/views/importAndExport/index.vue'], resolve)
        },
        {
          path: '/mergeTable',
          name: 'mergeTable',
          component: resolve => require(['@/views/mergeTable/index.vue'], resolve)
        },
        {
          path: '/count',
          name: 'count',
          component: resolve => require(['@/views/count/index.vue'], resolve)
        },
        {
          path: '/tag',
          name: 'tag',
          component: resolve => require(['@/views/tag/index.vue'], resolve)
        },
        {
          path: '/code',
          name: 'code',
          component: resolve => require(['@/views/code/index.vue'], resolve)
        },
        {
          path: '/tree',
          name: 'tree',
          component: resolve => require(['@/views/tree/index.vue'], resolve)
        }
      ]
    }
  ]
})
